//package com.xukehong.demo.config;
//
//
//
//import org.springframework.amqp.core.Binding;
//import org.springframework.amqp.core.BindingBuilder;
//import org.springframework.amqp.core.Queue;
//import org.springframework.amqp.core.TopicExchange;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
///**
// * @Author: xkh
// * @Date: 2019/4/30 17:03
// * @Version 1.0
// * 配置Queue(消息队列),采用Topic转发模式，再配置交换机(Exchant)
// * 需要在配置Queue的时候指定一个键使其和交换机绑定
// **/
//@Configuration
//public class RabbitMqConfig {
//
//    @Bean(name = "message")
//    public Queue queueMessage(){
//        return new Queue("topic.message");
//    }
//
//    @Bean(name = "messages")
//    public Queue queueMessages(){
//        return new Queue("topic.messages");
//    }
//
//    @Bean
//    public TopicExchange exchange(){
//        return new TopicExchange("exchange");
//    }
//
//    @Bean
//    Binding bindingExchangeMessage(@Qualifier("message") Queue queueMessage, TopicExchange exchange){
//        return BindingBuilder.bind(queueMessage).to(exchange).with("topic.message");
//    }
//
//    @Bean
//    Binding bindingExchangeMessages(@Qualifier("messages") Queue queueMessages,TopicExchange exchange){
//        return BindingBuilder.bind(queueMessages()).to(exchange).with("topic.#"); //#表示0个或者多个
//    }
//}
